package com.zhuoshi.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhuoshi.entity.Marketing;
import com.zhuoshi.entity.MarketingVoPo;
import com.zhuoshi.mapper.MarketingCustomMapper;
import com.zhuoshi.service.MarketingService;
/*
 * Author 海生
 */
@Service
@Transactional
public class MarketingServiceImpl  implements MarketingService{

	@Autowired
	private MarketingCustomMapper marketingCustomMapper;
	//查询所有接待记录
	public List<MarketingVoPo> selectJiLuAll() throws Exception {
		List<MarketingVoPo> marketingList = marketingCustomMapper.selectJiLuAll();
		return marketingList;
	}
	
	//删除客户接待记录
	public int deleteKuhujiedaiLu(int id) throws Exception {
		int rows =marketingCustomMapper.deleteKuhujiedaiLu(id);
		
		return rows;
	}

	//批量删除客户接待记录
	public int DeleteAllKuhujiedai(String[] id) throws Exception {
		int rows = marketingCustomMapper.DeleteAllKuhujiedai(id);
		
		return rows;
	}

	//添加客户接待记录
	public int addKuhujiedaijilu(Marketing marketing) throws Exception {
		int rows = marketingCustomMapper.addKuhujiedaijilu(marketing);
		System.out.println("service层....."+rows);
		return rows;
	}

	//查询显示客户姓名和业务员接待记录
	public List<MarketingCustomMapper> selectByNameAndUsername() throws Exception {
		List<MarketingCustomMapper> marketingList = marketingCustomMapper.selectByNameAndUsername();
		return marketingList;
	}
	
	//根据id查询一条接待记录
	public MarketingVoPo selectJiDaijiluById(int id) {
		MarketingVoPo vopo = marketingCustomMapper.selectJiDaijiluById(id);
		return vopo;
	}

	//修改客户记录
	public int updateKuhujiedaijilu(MarketingVoPo marketingvopo) {
		int rows = marketingCustomMapper.updateKuhujiedaijilu(marketingvopo);
		System.out.println("修改客户接待记录..service层..");
		return rows;
	}

	
	
	

}
